using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class mtn_allBatchNbMap : EntityTypeConfiguration<mtn_allBatchNb>
    {
        public mtn_allBatchNbMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Type, t.ID });

            // Properties
            this.Property(t => t.Type)
                .IsRequired()
                .HasMaxLength(15);

            this.Property(t => t.Period)
                .HasMaxLength(4);

            this.Property(t => t.batch)
                .IsFixedLength()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("mtn_allBatchNb");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.date).HasColumnName("date");
            this.Property(t => t.Period).HasColumnName("Period");
            this.Property(t => t.batch).HasColumnName("batch");
        }
    }
}
